﻿
namespace SistemaLogistica.Windows.Forms.Adquisicion.Reportes
{
    using System;
    using System.Windows.Forms;
    using SistemaLogistica.Windows.Helpers;

    public partial class CwfOrdenPedido : UserControl
    {
        public CwfOrdenPedido()
        {
            InitializeComponent();
        }

        private void CwfOrdenPedido_Load(object sender, EventArgs e)
        {
            
        }      

        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (this.cmbArea.Tag == null) return;

            int idArea = Convert.ToInt32(this.cmbArea.Tag);

            this.sistemaLogisticaDS.EnforceConstraints = false;
            this.reporteOrdenPedidoTableAdapter.Fill(this.sistemaLogisticaDS.ReporteOrdenPedido, this.dtpDesde.Value, this.dtpHasta.Value, idArea);
            this.rpvOrdenPedido.RefreshReport();
        }

        private void ubigeo1_seleccionarSucursal(object sender, int idSucursal)
        {
            this.cmbArea.Tag = 0;
            this.cmbArea.Text = string.Empty;
            Metodos.GetAreas(idSucursal, this.cmbArea.TreeView);
        }     
    }
}
